<template>
  <div>
    <p class="content" v-html="content"></p>
  </div>
</template>
<script>
export default {
  data() {
    return {
      fileName: '',
      content: ''
    }
  },
  mounted() {
    this.fileName = this.$route.query.fileName
    this.getContent()
  },
  methods: {
    getContent() {
      this.axios({
        url: "http://localhost:8091/preview?path=" + this.fileName,
        method: "get"
      })
      .then(res => {
        this.content = res.data.content
      })
    }
  }
}
</script>
<style lang="scss" scoped>
  .content {
    display: flex;
    justify-content: center;
    margin-top: -50px;
  }
</style>